Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix access local registry by localhost:4873 when running in a devcontainer #28239

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ThePlenkov
Copy link
Contributor

Current Behavior

If repo is opened in a devcontainer on the local machine, verdaccio is not reachable by localhost:4873

Expected Behavior

Running command like pnpm local-registry should start a local registry and this registry must be reachable via localhost

Related Issue(s)

Fixes #28238

Copy link

vercel bot commented Oct 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Visit Preview Oct 2, 2024 1:40pm

@ThePlenkov
Copy link
Contributor Author

So the solution is to listen to 0.0.0.0 instead of localhost. I honestly do not know what is the principal difference - because it's not happening with any other web app i ran in containers, but as we can see they do this too in their docker container:
https://github.com/verdaccio/verdaccio/blob/master/Dockerfile#L58

@ThePlenkov ThePlenkov changed the title chore(repo): fix local registry access by localhost:4873 when running… Fix access local registry by localhost:4873 when running in a devcontainer Oct 2, 2024
@ThePlenkov
Copy link
Contributor Author

We need to check unit tests. Seems like jest is waiting for localhost to start e2e

@ThePlenkov
Copy link
Contributor Author

alternative to using the option would be probably not using port at all. It is a good question - why verdaccio is ignoring listen parameter in the config, probably because of the directly given port. It will be easier also to determine in e2e where verdaccio is running - it could be consumed form the config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot set up a local registry if NX project is opened in a devcontainer ( Docker Desktop )
2 participants